<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>sgp4oo: Fichero Fuente TestingClass.cpp</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generado por Doxygen 1.6.3 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="main.html"><span>Página&nbsp;principal</span></a></li>
      <li><a href="annotated.html"><span>Clases</span></a></li>
      <li class="current"><a href="files.html"><span>Archivos</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>Lista&nbsp;de&nbsp;archivos</span></a></li>
      <li><a href="globals.html"><span>Miembros&nbsp;de&nbsp;los&nbsp;ficheros</span></a></li>
    </ul>
  </div>
<h1>TestingClass.cpp</h1><a href="_testing_class_8cpp.html">Ir a la documentación de este archivo.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * TestingClass.cpp</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> */</span>
<a name="l00005"></a>00005 
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="_testing_class_8h.html">TestingClass.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="sgp4__date_8h.html">sgp4_date.h</a>&quot;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="sgp4__math_8h.html">sgp4_math.h</a>&quot;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &quot;<a class="code" href="sgp4__util_8h.html">sgp4_util.h</a>&quot;</span>
<a name="l00011"></a>00011 
<a name="l00012"></a>00012 
<a name="l00013"></a>00013 <a class="code" href="_testing_class_8cpp.html#a8ef1dd93ce5484c12f75a86e7ecb634d">CPPUNIT_TEST_SUITE_REGISTRATION</a>(<a class="code" href="class_testing_class.html">TestingClass</a>);
<a name="l00014"></a>00014 
<a name="l00015"></a>00015 
<a name="l00016"></a>00016 
<a name="l00017"></a><a class="code" href="class_testing_class.html#a7b262284974a1e1193631c9c51580994">00017</a> <span class="keywordtype">void</span> <a class="code" href="class_testing_class.html#a7b262284974a1e1193631c9c51580994">TestingClass::setUp</a>(){}
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 
<a name="l00020"></a><a class="code" href="class_testing_class.html#a65d85bcb8eeb0f35f60812947fceba8d">00020</a> <span class="keywordtype">void</span> <a class="code" href="class_testing_class.html#a65d85bcb8eeb0f35f60812947fceba8d">TestingClass::tearDown</a>(){}
<a name="l00021"></a>00021 
<a name="l00022"></a>00022 
<a name="l00023"></a>00023 
<a name="l00024"></a><a class="code" href="class_testing_class.html#a7215c3f199902d6312b4f55485306998">00024</a> <span class="keywordtype">void</span> <a class="code" href="class_testing_class.html#a7215c3f199902d6312b4f55485306998">TestingClass::testComprobarFechas</a>(){
<a name="l00025"></a>00025                 <span class="keywordtype">double</span> jd;<span class="keywordtype">double</span>  salida;
<a name="l00026"></a>00026                 <span class="keywordtype">int</span>  year; <span class="keywordtype">int</span> mon; <span class="keywordtype">int</span> day; <span class="keywordtype">int</span> hr; <span class="keywordtype">int</span> min;<span class="keywordtype">double</span> sec;
<a name="l00027"></a>00027                 jd=2456020.010;
<a name="l00028"></a>00028 
<a name="l00029"></a>00029 
<a name="l00030"></a>00030                 <a class="code" href="classsgp4__date.html#a8bd260e36fb647c9ff8f1c9eefe12f6a" title="this procedure finds the year, month, day, hour, minute and second given the julian...">sgp4_date::invjday</a>(jd,year,mon,day,hr,min,sec);
<a name="l00031"></a>00031                 <a class="code" href="classsgp4__date.html#a3c1affde9b5a9badeec11f39f0fe1552" title="this file contains extra routines needed for the main test program for sgp4.">sgp4_date::jday</a>(year,mon,day,hr,min,sec,salida);
<a name="l00032"></a>00032 
<a name="l00033"></a>00033                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Año no correcto&quot;</span>,2012,year);
<a name="l00034"></a>00034                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Mes no correcto&quot;</span>,4,mon);
<a name="l00035"></a>00035                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Dia no correcto&quot;</span>,2,day);
<a name="l00036"></a>00036                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Hora no correcta&quot;</span>,12,hr);
<a name="l00037"></a>00037                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Minuto no correcto&quot;</span>,14,min);
<a name="l00038"></a>00038                 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(<span class="stringliteral">&quot;Segundo no correcto &quot;</span>,24,sec,0.01f);
<a name="l00039"></a>00039                 CPPUNIT_ASSERT_DOUBLES_EQUAL(jd,salida,0.00001f);
<a name="l00040"></a>00040 
<a name="l00041"></a>00041 
<a name="l00042"></a>00042 }
<a name="l00043"></a>00043 
<a name="l00044"></a><a class="code" href="class_testing_class.html#a7bcdcae9673f838d264c4600a6684089">00044</a> <span class="keywordtype">void</span> <a class="code" href="class_testing_class.html#a7bcdcae9673f838d264c4600a6684089">TestingClass::testDiaBisiesto</a>(){
<a name="l00045"></a>00045                 <span class="keywordtype">double</span> jd;<span class="keywordtype">double</span>  salida;
<a name="l00046"></a>00046                 <span class="keywordtype">int</span>  year; <span class="keywordtype">int</span> mon; <span class="keywordtype">int</span> day; <span class="keywordtype">int</span> hr; <span class="keywordtype">int</span> min;<span class="keywordtype">double</span> sec;
<a name="l00047"></a>00047                 jd=2488129.008472;
<a name="l00048"></a>00048                 <a class="code" href="classsgp4__date.html#a8bd260e36fb647c9ff8f1c9eefe12f6a" title="this procedure finds the year, month, day, hour, minute and second given the julian...">sgp4_date::invjday</a>(jd,year,mon,day,hr,min,sec);
<a name="l00049"></a>00049                 <a class="code" href="classsgp4__date.html#a3c1affde9b5a9badeec11f39f0fe1552" title="this file contains extra routines needed for the main test program for sgp4.">sgp4_date::jday</a>(year,mon,day,hr,min,sec,salida);
<a name="l00050"></a>00050 
<a name="l00051"></a>00051                 CPPUNIT_ASSERT_DOUBLES_EQUAL(jd,salida,0.00001f);
<a name="l00052"></a>00052 
<a name="l00053"></a>00053                 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE(<span class="stringliteral">&quot;Segundo no correcto &quot;</span>,12,sec,0.1f);
<a name="l00054"></a>00054                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Minuto no correcto&quot;</span>,12,min);
<a name="l00055"></a>00055                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Hora no correcta&quot;</span>,12,hr);
<a name="l00056"></a>00056                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Año no correcto&quot;</span>,2100,year);
<a name="l00057"></a>00057                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Dia no correcto&quot;</span>,1,day);
<a name="l00058"></a>00058                 CPPUNIT_ASSERT_EQUAL_MESSAGE(<span class="stringliteral">&quot;Mes no correcto&quot;</span>,3,mon);
<a name="l00059"></a>00059 }
<a name="l00060"></a>00060 
<a name="l00061"></a><a class="code" href="class_testing_class.html#aa8e461cec8541b143b75fae869b62127">00061</a> <span class="keywordtype">void</span> <a class="code" href="class_testing_class.html#aa8e461cec8541b143b75fae869b62127">TestingClass::testDiaSuperiorFebrero2100</a>(){
<a name="l00062"></a>00062 
<a name="l00063"></a>00063             <span class="keywordtype">double</span> jd;<span class="keywordtype">double</span>  salida;
<a name="l00064"></a>00064                 <span class="keywordtype">int</span>  year=2110; <span class="keywordtype">int</span> mon=1; <span class="keywordtype">int</span> day=1; <span class="keywordtype">int</span> hr=13; <span class="keywordtype">int</span> min=12;<span class="keywordtype">double</span> sec=12;
<a name="l00065"></a>00065 
<a name="l00066"></a>00066                 jd=2491722.050139;
<a name="l00067"></a>00067 
<a name="l00068"></a>00068                 <a class="code" href="classsgp4__date.html#a3c1affde9b5a9badeec11f39f0fe1552" title="this file contains extra routines needed for the main test program for sgp4.">sgp4_date::jday</a>(year,mon,day,hr,min,sec,salida);
<a name="l00069"></a>00069 
<a name="l00070"></a>00070                 CPPUNIT_ASSERT_DOUBLES_EQUAL(jd,salida,0.00001f);
<a name="l00071"></a>00071 }
<a name="l00072"></a>00072 
<a name="l00073"></a><a class="code" href="class_testing_class.html#a2cbf72044243dc0d966d6bfc574b0a42">00073</a> <span class="keywordtype">void</span> <a class="code" href="class_testing_class.html#a2cbf72044243dc0d966d6bfc574b0a42">TestingClass::testGrado</a>(){
<a name="l00074"></a>00074         <span class="keywordtype">double</span> valor1[3],valor2[3];
<a name="l00075"></a>00075                      valor1[0]=1;
<a name="l00076"></a>00076                      valor1[1]=0;
<a name="l00077"></a>00077                      valor1[2]=0;
<a name="l00078"></a>00078 
<a name="l00079"></a>00079                      <span class="keywordtype">double</span> clave=1;
<a name="l00080"></a>00080 
<a name="l00081"></a>00081                 CPPUNIT_ASSERT_EQUAL(clave,<a class="code" href="classsgp4__math.html#a66bce8799e00fe4c922b9f0434b6128e" title="this procedure finds the magnitude of a vector">sgp4_math::mag</a>(valor1));
<a name="l00082"></a>00082 }
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 
<a name="l00085"></a><a class="code" href="class_testing_class.html#afc7a96d6e64cc1d4b0096238fcedde25">00085</a> <span class="keywordtype">void</span> <a class="code" href="class_testing_class.html#afc7a96d6e64cc1d4b0096238fcedde25">TestingClass::testFichero</a>(){
<a name="l00086"></a>00086                 <span class="keywordtype">char</span> directorio[128];
<a name="l00087"></a>00087                 <span class="keywordtype">char</span> directorio2[128];
<a name="l00088"></a>00088                 strcpy(directorio,<span class="stringliteral">&quot;Nuevo&quot;</span>);
<a name="l00089"></a>00089                 strcpy(directorio2,<span class="stringliteral">&quot;Viejo&quot;</span>);
<a name="l00090"></a>00090 
<a name="l00091"></a>00091                 CPPUNIT_ASSERT_EQUAL(<span class="keyword">true</span>,(<a class="code" href="classsgp4__util.html#a8143158a0b55b98d5e23d5cd34c62077">sgp4_util::identicos</a>(directorio,directorio2)));
<a name="l00092"></a>00092 }
<a name="l00093"></a>00093 
<a name="l00094"></a>00094 
<a name="l00095"></a>00095 
<a name="l00096"></a>00096 
<a name="l00097"></a>00097 
<a name="l00098"></a>00098 
<a name="l00099"></a>00099 
<a name="l00100"></a>00100 
<a name="l00101"></a>00101 
<a name="l00102"></a>00102 
<a name="l00103"></a>00103 
</pre></div></div>
<hr class="footer"/><address style="text-align: right;"><small>Generado el Tue May 22 09:43:43 2012 para sgp4oo por&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>
